/**
 * 
 */
package co.fitstart.coach.dao;

import com.demo2do.core.persistence.annotation.Dynamic;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;

import co.fitstart.entity.principal.Principal;

/**
 * @author downpour
 *
 */
@Dynamic("hibernate")
public interface PrincipalDao {
    
    /**
     * get principal by mobile
     * 
     * @param mobile
     * @return
     */
    @Query("FROM Principal principal WHERE principal.disabled = false AND principal.enterprise = true AND principal.mobile = :mobile")
    public Principal get(@Variable("mobile") String mobile);
    
}
